home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14133 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.accent.net!news
  2. From: dallaire@megatoon.com (Guy Dallaire)
  3. Newsgroups: comp.lang.c
  4. Subject: HELP: system() exit status
  5. Date: Fri, 12 Apr 1996 00:35:01 GMT
  6. Organization: Accent Internet
  7. Message-ID: <4kk8m6$omb@news.accent.net>
  8. NNTP-Posting-Host: 198.53.28.127
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. Hi,
  12.  
  13. I have a program which does a lot of "system()" calls here.  Is it
  14. safe to assume that ANY return code other than 0 (on a UNIX) system
  15. means that the command specified as a parameter to system() did dot
  16. work ?  
  17.  
  18. NOTE: I also checked for -1 which indicates that system() could not
  19. spawn the command.
  20.  
  21. Also: Most man pages do not explicitly state what return status one
  22. can expect after calling some system call/utility. For example, it's
  23. not stated that the `cp` command exits with value x, y, or z depending
  24. on the case where the source file is not present, the destination file
  25. is write protect, anmd so on. Can was assume that any return status of
  26. 0 means that all went well and anything else means there has been an
  27. error ?
  28.  
  29. That question always puzzled me...
  30.  
  31.                 Thanks !
  32.  
  33. P.S.: Please reply by e-mail also
  34.  
  35.